package cn.ylz.ylmall.order.dao.persist.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import cn.ylz.ylmall.order.pojo.entity.OrderItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
* @author ks
* @description 针对表【order_item(订单商品表)】的数据库操作Mapper
* @createDate 2023-08-10 11:36:41
* @Entity cn.ylz.ylmall.order.pojo.entity.OrderItem
*/
@Mapper
public interface OrderItemMapper extends BaseMapper<OrderItem> {

    /**
     * 查找商品库存
     * @param productId
     * @return
     */
    int selectProductStock(int productId);

    /**
     * 修改商品库存
     * @param productId
     * @param stock
     * @return
     */
    int updateProductStock(int productId,int stock);

    OrderItem selectByOrderNo(@Param("orderNo") String orderNo);



}




